package com.zf.shuashua.ui.popup;

import android.app.Activity;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.CenterPopupView;
import com.zf.shuashua.R;
import com.zf.shuashua.widget.MultiScrollNumber;

/**
 * 首页泡泡弹框
 */
public class ExitPopup extends CenterPopupView {
    private OnPopupListener mListener;

    public ExitPopup(@NonNull Activity context) {
        super(context);
    }

    public void setPopupListener(OnPopupListener listener) {
        this.mListener = listener;
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.exit_popup;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        setupView();
    }

    private void setupView() {
        findViewById(R.id.btTitle).setOnClickListener(v -> {
            dismiss();
            if (mListener != null) {
                mListener.onNext();
            }
        });
        findViewById(R.id.tvExit).setOnClickListener(view -> {
            dismiss();
            if (mListener != null) {
                mListener.onClose();
            }
        });
    }
}

